package cc.rengu.igas.momp.common.enums;

/**
 * 查询角色枚举值
 *
 * @author Jinan Liu
 * @version 1.0.0
 * @date 2020/3/24 16:19
 */
public enum QueryRoleEnum {

    /**
     * 银行审计岗
     */
    BANK_BASIC_QUERY_ROLE("00", "银行审计岗"),
    /**
     * 银行审批岗
     */
    BANK_AUDIT_QYERY_ROLE("01", "银行审批岗"),
    /**
     * 银行发布岗
     */
    BANK_PUBLISH_QYERY_ROLE("02", "银行发布岗"),
    /**
     * 商户
     */
    MCHNT_QYERY_ROLE("10", "商户"),
    /**
     * 收银员
     */
    CASHIER_QYERY_ROLE("20", "收银员"),
    /**
     * 代理商
     */
    AGENT_QYERY_ROLE("30", "代理商"),
    /**
     * 用户
     */
    USER_QYERY_ROLE("40", "用户"),
    /**
     * 错误的查询角色
     */
    WRONG_QUERY_ROLE("EE", "错误的查询角色");

    /**
     * 查询角色编码
     */
    private String queryRoleCode;
    /**
     * 查询角色描述
     */
    private String queryRoleDesc;

    QueryRoleEnum(String queryRoleCode, String queryRoleDesc) {
        this.queryRoleCode = queryRoleCode;
        this.queryRoleDesc = queryRoleDesc;
    }

    public String getQueryRoleCode() {
        return queryRoleCode;
    }

    public void setQueryRoleCode(String queryRoleCode) {
        this.queryRoleCode = queryRoleCode;
    }

    public String getQueryRoleDesc() {
        return queryRoleDesc;
    }

    public void setQueryRoleDesc(String queryRoleDesc) {
        this.queryRoleDesc = queryRoleDesc;
    }

    /**
     * 判断输入项属于那种枚举值
     *
     * @param value 待检查数据
     * @return cc.rengu.igas.momp.common.enums.QueryRoleEnum 查询角色枚举值
     * @author Jinan Liu
     * @date 2020/5/18 14:46
     */
    public static QueryRoleEnum getByValue(String value) {
        for (QueryRoleEnum queryRoleEnum : values()) {
            if (queryRoleEnum.getQueryRoleCode().equals(value)) {
                return queryRoleEnum;
            }
        }
        return WRONG_QUERY_ROLE;
    }
}
